/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Dao;

import Pojo.ChiTietHoaDon;
import Util.MySqlDataAccessHelper;

/**
 *
 * @author USER
 */
public class ChiTietHoaDonDAO {

    public static boolean themChiTietHoaDon(ChiTietHoaDon cthd) {
        boolean kq;
        MySqlDataAccessHelper helper = new MySqlDataAccessHelper();
        helper.open();

        String sql = String.format("INSERT INTO `chi_tiet_hoa_don` (`ma_hoa_don`,`ma_sach`,`so_luong_ban`,`gia_ban`) VALUES (%d,%d,%d,%f)",
                cthd.getMaHoaDon(), cthd.getMaSach(), cthd.getSoLuongBan(), cthd.getGiaBan());

        kq = helper.executeNonQuery(sql);
        helper.close();
        return kq;
    }
}
